package com.wyy.mall.tiny.controller;

import com.wyy.mall.tiny.common.api.CommonResult;
import com.wyy.mall.tiny.service.RedisService;
import com.wyy.mall.tiny.service.UmsMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 会员登录注册管理
 * created by 伍猷煜 on 2021/5/11 10:43 星期二
 */

@Api(tags = "UmsMemberController", description = "会员登录注册管理")
@Controller
@RequestMapping("/sso")
public class UmsMemberController {

    @Autowired
    private UmsMemberService mUmsMemberService;

    @ApiOperation("获取验证码")
    @GetMapping("/getAuthCode")
    @ResponseBody
    public CommonResult getAuthCode(@RequestParam String telephone) {
        return mUmsMemberService.generateAuthCode(telephone);
    }

    @ApiOperation("校验验证码")
    @PostMapping("/verifyAuthCode")
    @ResponseBody
    public CommonResult verifyAuthCode(@RequestParam String telephone, @RequestParam String code) {
        return mUmsMemberService.verifyAuthCode(telephone, code);
    }
}
